{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"test data\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f0 : EasyForm = new EasyForm(\"form0\")\n",
    "f0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f1 = new EasyForm(\"form1\")\n",
    "f1.addTextField(\"field name\")\n",
    "f1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f1.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f1.put(\"field name\", \"1text from code1\")\n",
    "f1.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f2 = new EasyForm(\"form2\")\n",
    "f2.addTextField(\"field name\", 10)\n",
    "f2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f3 = new EasyForm(\"form3\")\n",
    "f3.addTextArea(\"field name\")\n",
    "f3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f3.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f3.put(\"field name\", \"3text from code3\")\n",
    "f3.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f4 = new EasyForm(\"form4\")\n",
    "f4.addTextArea(\"field name\", 20, 5)\n",
    "f4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f5 = new EasyForm(\"form5\")\n",
    "f5.addTextArea(\"field name\", \"5initial value5\")\n",
    "f5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f6 = new EasyForm(\"form6\")\n",
    "f6.addCheckBox(\"field name\")\n",
    "f6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f6.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f6.put(\"field name\", \"false\")\n",
    "f6.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f7 = new EasyForm(\"form7\")\n",
    "f7.addCheckBox(\"field name\", true)\n",
    "f7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f8 = new EasyForm(\"form8\")\n",
    "f8.addComboBox(\"field name\", Seq(\"one\", \"two\", \"three\"))\n",
    "f8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f8.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f8.put(\"field name\", \"three\")\n",
    "f8.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f9 = new EasyForm(\"form9\")\n",
    "f9.addList(\"field name\", Seq(\"one\", \"two\", \"three\"))\n",
    "f9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f9.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f9.put(\"field name\", Seq(\"one\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f10 = new EasyForm(\"form10\")\n",
    "f10.addList(\"field name\", Seq(\"one\", \"two\", \"three\"), false)\n",
    "f10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f10.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f11 = new EasyForm(\"form11\")\n",
    "f11.addList(\"field name\", Seq(\"one\", \"two\", \"three\", \"four\"), 2)\n",
    "f11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f12 = new EasyForm(\"form12\")\n",
    "f12.addCheckBoxes(\"field name\", Seq(\"one\", \"two\", \"three\", \"four\"))\n",
    "f12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12.put(\"field name\", Seq(\"one\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f13 = new EasyForm(\"form13\")\n",
    "f13.addCheckBoxes(\"field name\", Seq(\"one\", \"two\", \"three\"), EasyForm.HORIZONTAL)\n",
    "f13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f14 = new EasyForm(\"form14\")\n",
    "f14.addRadioButtons(\"field name\", Seq(\"one\", \"two\", \"three\"))\n",
    "f14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f14.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f14.put(\"field name\", \"three\")\n",
    "f14.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f15 = new EasyForm(\"form15\")\n",
    "f15.addRadioButtons(\"field name\", Seq(\"one\", \"two\", \"three\"), EasyForm.HORIZONTAL)\n",
    "f15"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f16 = new EasyForm(\"form16\")\n",
    "val dt16 = f16.addDatePicker(\"field name\")\n",
    "f16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f16.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dt16.setDate(\"20170527\")\n",
    "f16.get(\"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "val f10 = new EasyForm(\"form10\")\n",
    "val f11 = new EasyForm(\"form11\")\n",
    "f10.addButton(\"run tag\", \"tag1\")\n",
    "val button11 = f10.addButton(\"actionPerformed\")\n",
    "button11.actionPerformed = new EasyFormListener {\n",
    "      override def execute(value: String): Unit = f11.put(\"field4\", \"from actionPerformed\");\n",
    "}\n",
    "f10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f11.put(\"field2\", \"test text\")\n",
    "f11.get(\"field2\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "tag1"
    ]
   },
   "outputs": [],
   "source": [
    "f11.addTextField(\"field1\").onInit(new EasyFormListener {\n",
    "      override def execute(value: String): Unit = {\n",
    "        f11.put(\"field1\", \"from onInit\");\n",
    "      }\n",
    "    });\n",
    "f11.addTextField(\"field2\").onChange(new EasyFormListener {\n",
    "      override def execute(value: String): Unit = {\n",
    "        field3.setValue(f11.get(\"field2\") + \" from onChange\");\n",
    "      }\n",
    "    });\n",
    "val field3 = f11.addTextField(\"field3\")\n",
    "f11.addTextField(\"field4\")\n",
    "f11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import com.twosigma.beakerx.widget.IntSlider\n",
    "\n",
    "val w = new IntSlider()\n",
    "val f12 = new EasyForm(\"form12\")\n",
    "f12.addWidget(\"IntSlider\",w)\n",
    "f12.put(\"IntSlider\", \"50\")\n",
    "f12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f12.get(\"IntSlider\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "beakerx_kernel_parameters": {},
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Scala",
   "language": "scala",
   "name": "scala"
  },
  "language_info": {
   "codemirror_mode": "text/x-scala",
   "file_extension": ".scala",
   "mimetype": "",
   "name": "Scala",
   "nbconverter_exporter": "",
   "version": "2.11.12"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
